#pragma once

#include "../../renderer/Buffer.h"

namespace lazy {

    class GLVertexBuffer : public VertexBuffer {
    public:
        GLVertexBuffer(uint32_t size);
        GLVertexBuffer(float* vertices, uint32_t size);

        ~GLVertexBuffer() override;

        void Bind() override;

        void Unbind() override;

        const BufferLayout &GetLayout() const override;

        void SetLayout(const BufferLayout &layout) override;

        void SetData(const void *data, uint32_t size) override;


    private:
        uint32_t m_BufferID;
        BufferLayout m_Layout;
    };


    class GLIndexBuffer : public IndexBuffer {
    public:
        explicit GLIndexBuffer(uint32_t* indices, uint32_t count);
        ~GLIndexBuffer() override;
        void Bind() override;
        void Unbind() override;

        inline uint32_t GetCount() const override {
            return m_Count;
        };

    private:
        uint32_t m_BufferID;
        uint32_t m_Count;
    };

    class GLUniformBuffer : public UniformBuffer {
    public:
        GLUniformBuffer(uint32_t size, uint32_t binding);
        ~GLUniformBuffer() override;
        void SetData(const void *data, uint32_t size, uint32_t offset) override;

    private:
        uint32_t m_BufferID = 0;
    };

} // lazy
